import { ClassSerializerInterceptor, Module } from '@nestjs/common';
import { ApiModule } from './api/api.module';
import { ConfigModule } from '@nestjs/config';
import { CommonModule } from './common/common.module';
import CommonConfig from './common/common.config';
import { APP_INTERCEPTOR } from '@nestjs/core';

@Module({
  providers: [
    {
      provide: APP_INTERCEPTOR,
      useClass: ClassSerializerInterceptor,
    },
  ],
  imports: [
    CommonModule,
    ApiModule,
    ConfigModule.forRoot({
      isGlobal: true,
      cache: true,
      load: [CommonConfig],
    }),
  ],
})
export class AppModule {}
